﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MyIdolUIFrameWork;
using UnityEngine.UI;

public class UIRemoveAd : UIScene 
{

    private UISceneWidget cancelRemoveAd;
    private UISceneWidget removeAdBtn;
    private UISceneWidget restoreBtn;
    private Text text_removeAd;
    protected override void Start()
    {
        base.Start();
        InitWerght();
    }

    private void InitWerght()
    {
        cancelRemoveAd = GetWidget("Cancel");
        cancelRemoveAd.onClick += CancelRemoveAdClick;

        removeAdBtn = GetWidget("RemoveAd");
        removeAdBtn.onClick += RemoveAdClick;

        restoreBtn = GetWidget("Restore");
        restoreBtn.onClick += RestoreRemoveAdClick;

        text_removeAd = Global.FindChild<Text>(transform, "Text_RemoveAd");
    }

    private void CancelRemoveAdClick()
    {
        SetVisible(false);
    }

    private void RemoveAdClick()
    {
        PurchaseProxy.pay(1);
    }

    private void RestoreRemoveAdClick()
    {
        PurchaseProxy.restore(1);
    }
}
